import request from '../utils/request'

export default {
  get (id) {
    return request.get('/api/drafts/' + id)
  },
  getByPostId (id) {
    return request.get('/api/drafts/posts/' + id)
  },
  history (postId) {
    return request.get('/api/drafts/history/' + postId)
  },
  save (body) {
    return request.post('/api/drafts', body)
  },
  publish (body) {
    return request.post('/api/drafts/publish', body)
  },
  remove (id) {
    return request.delete('/api/drafts/' + id)
  }
}
